<template>
    <div class="demo">
        beforeUnmount和unmounted
    </div>
</template>
<script>
export default {
    name: 'vueMy',
    data() {
        return {
            msg: 1,
        }
    },
    mounted() {
    },
    beforeUnmount() {
        console.log('----beforeUnmount');
    },
    unmounted() {
        console.log('msg', this.data);
        console.log('----unmounted');
    }
}
</script>
<style scoped>
.demo {
    width: 210px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    margin-top: 10px;
    background-color: #00ba88;
    color: #fff;
}
</style>